package com.cxso.example.request.report;

import com.cxso.example.enums.report.FinancialTypeEnum;
import com.cxso.example.enums.report.PaymentTypeEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Getter
@Setter
public class ReportFinancialRequest implements Serializable {

    @NotBlank
    @Schema(description = "主体id")
    private String bodyId;

    @Schema(description = "运单号")
    @NotBlank(message = "运单号不能为空")
    private String shippingNoteNumber;

    @Valid
    @NotEmpty
    @Schema(description = "资金流水单", example = "完整流水(包含收入,支出)")
    private List<Financial> financialList;


    @Getter
    @Setter
    public static class Financial {

        @Schema(description = "流水类型")
        private FinancialTypeEnum financialType;

        @Schema(description = "付款方式代码")
        private PaymentTypeEnum paymentMeansCode;

        @Schema(description = "付款方名称")
        private String paymentName;

        @Schema(description = "付款账户信息")
        private String paymentAccount;

        @Schema(description = "付款银行")
        private String paymentBankName;

        @Schema(description = "收款方名称")
        private String recipient;

        @Schema(description = "收款账户信息")
        private String receiptAccount;

        @Schema(description = "收款人身份证")
        private String receiptIdCard;

        @Schema(description = "收款银行")
        private String receiptBankName;

        @Schema(description = "收款银行代码")
        private String receiptBankCode;

        @Schema(description = "流水号/序列号")
        private String sequenceCode;

        @Schema(description = "实际支付金额")
        private BigDecimal monetaryAmount;

        @Schema(description = "油卡金额")
        private BigDecimal fuelAmount;

        @Schema(description = "单证号")
        private String documentNumber;

        @Schema(description = "实际承运人/托运人名称")
        private String carrier;

        @Schema(description = "实际承运人/托运人统一社会信用代码或证件号码")
        private String actualCarrierId;

        @Schema(description = "合同约定付款时间")
        private Date appointmentTime;

        @Schema(description = "实际支付时间")
        private Date payTime;

        @Schema(description = "代收资金付款方式代码")
        private PaymentTypeEnum replaceMeansCode;

        @Schema(description = "代收资金付款方名称")
        private String replacePaymentName;

        @Schema(description = "代收资金收款方名称")
        private String replaceRecipient;

        @Schema(description = "代收资金流水号/序列号")
        private String replaceSequenceCode;

        @Schema(description = "代收资金实际支付金额")
        private BigDecimal replaceMonetaryAmount;

        @Schema(description = "代收资金实际支付时间")
        private Date replacePayTime;

        @Schema(description = "代收资金收款方身份证")
        private String replaceReceiptIdCard;

        @Schema(description = "代收资金付款方身份证")
        private String replacePaymentIdCard;

        @Schema(description = "流水类型 1收入 2支出", example = "1")
        private Integer statementType;

        @Schema(description = "回单地址")
        private String receiptUrl;

    }


}
